<?php
class modelo extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }
    function consulta($nickname, $clave)
    {
        $this->db->select('*');
        $this->db->where('per_usu',$nickname);
        $this->db->where('per_pass',$clave);
        return $this->db->get('personas');
    }
    function buscaUsuarios()
    {
        $this->db->select('*');
        return $this->db->get('personas');
    }
    function guardaRegistro($nombre,$rut,$correo,$nickname,$clave,$permiso)
    {
        $data1 = array("per_rut"=>$rut,"per_num"=>$nombre,"per_email"=>$correo,"per_usu"=>$nickname,"per_pass"=>$clave,"pf_cod"=>$permiso);
        $this->db->insert('personas',$data1);
        
    }
    function consultaPermiso($nickname,$clave)
    {
        $this->db->select('pf_cod');
        $this->db->where('per_usu',$nickname);
        $this->db->where('per_pass',$clave);
        return $this->db->get('personas');
    }
    function buscaUsuario(){
        $this->db->select('*');
        return $this->db->get('personas');
    }
}
?>
